1. Field
The present invention relates generally to graphics systems and more particularly to graphics-rendering systems.
2. Background Information
Computer graphics systems are commonly used for displaying graphical representations of objects on a two-dimensional video display screen. Current computer graphics systems provide highly detailed representations and are used in a variety of applications. In typical computer graphics systems, an object to be represented on the display screen is broken down into graphics primitives. Primitives are basic components of a graphics display and may include points, lines, vectors and polygons, such as triangles and quadrilaterals. Typically, a hardware/software scheme is implemented to render or draw the graphics primitives that represent a view of one or more objects being represented on the display screen.
The primitives of the three-dimensional objects to be rendered are defined by a host computer in terms of primitive data. For example, when the primitive is a triangle, the host computer may define the primitive in terms of X, Y and Z coordinates of its vertices, as well as the red, green and blue (R, G and B) color values of each vertex. Additional primitive data may be used in specific applications.
Image rendering is the conversion of a high-level object-based description into a graphical image for display on some display device. For example, an act of image rendering occurs during the conversion of a mathematical model of a three-dimensional object or scene into a bitmap image. Another example of image rendering is converting an HTML document into an image for display on a computer monitor. Typically, a hardware device referred to as a graphics-rendering engine performs these graphics processing tasks. Graphics-rendering engines typically render scenes into a buffer that is subsequently output to the graphical output device, but it is possible for some rendering-engines to write their two-dimensional output directly to the output device. The graphics-rendering engine interpolates the primitive data to compute the display screen pixels that represent the each primitive, and the R, G and B color values of each pixel.
A graphics-rendering system (or subsystem), as used herein, refers to all of the levels of processing between an application program and a graphical output device. A graphics engine can provide for one or more modes of rendering, including zone rendering. Zone rendering attempts to increase overall 3D rendering performance by gaining optimal render cache utilization, thereby reducing pixel color and depth memory read/write bottlenecks. In zone rendering, a screen is subdivided into an array of zones and per-zone instruction bins, used to hold the entire primitive and state setting instructions required to render each sub-image, are generated. Whenever a primitive intersects or possibly intersects a zone, that primitive instruction is placed in the bin for that zone. In particular, a bounding box is generated to enclose the primitive and all the bins associated with zones lying inside the bounding box are updated. In most cases, the primitive does not intersect all of the zones lying within the bounding box. Updating all of the bins, including those not associated with intersected zones, negates performance benefits of binning, especially for scenes with large, skinny polygons.
Some primitives will intersect more than one zone, in which case the primitive instruction is replicated in the corresponding bins. This process is continued until the entire scene is sorted into the bins. Following the first pass of building a bin for each zone intersected by a primitive, a second zone-by-zone rendering pass is performed. In particular, the bins for all the zones are rendered to generate the final image.
Zone rendering performance, particularly the binning process, is especially important in unified memory architectures where memory bandwidth is at a premium. Processing bins associated with non-intersected zones unnecessarily increases memory bandwidth requirements. Moreover, the graphics-rendering engine utilizes additional memory bandwidth to process the binned command structures associated with the bins associated with non-intersected zones.
What are needed therefore are a method, apparatus and system for determining the zones that a polygon overlaps to minimize the bins that are updated during binning.